package cn.tedu.spring.scope;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 测试UserController的单例和多例模式
 */
public class TestUserController {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext
                ("cn.tedu.spring.scope");
        UserController bean1 = context.getBean(UserController.class);
        System.out.println(bean1);
        UserController bean2 = context.getBean(UserController.class);
        System.out.println(bean2);

    }
}
